package com.hualude.roadsign.repository;

import com.hualude.roadsign.dto.MenuDto;
import com.hualude.roadsign.model.MenuEntity;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.Repository;

import java.util.List;

/**
 * Created by SN on 2017/2/18.
 */
public interface MenuRepository extends Repository<MenuEntity, Long> {

    /**
     * @Description: 根据菜单Ids获取菜单信息
     * @Author: SN
     * @Date: 2017/2/20 23:27
     */
    public List<MenuDto> getMenuByIds(String menuIds, String menuIds2, Integer orgType) throws Exception;

    /**
     * @Description: 根据菜单Ids获取菜单信息
     * @Author: SN
     * @Date: 2017/2/20 23:27
     */
    public List<MenuDto> getPowerByUserId(Integer userId);


    @Query(value = "select new com.hualude.roadsign.dto.MenuDto(menuId,menuName,menuFather,menuType,menuSort) from MenuEntity")
    public List<MenuDto> getMenu4List() throws Exception;
}
